PC/CALCULATOR is a software program that will turn your IBM PC into a program-
mable multi-function RPN (Reverse Polish Notation) calculator. It features 16
visible memories, 7 function key modes, and 14 number display formats. In-
cluded is a background version of the calculator. Once loaded into your PC, it
can be easily accessed from within another program.
COPYRIGHT
PC/CALCULATOR may be used on only one computer at a time. The distribution
diskette may be duplicated for backup purposes only. Distributing copies of
the programs or documentation is illegal.
GETTING STARTED
Before you begin using PC/CALCULATOR, please take the time to duplicate your
distribution diskette either to a backup floppy or to a hard disk. I highly
recommend that you use this backup version and keep the distribution diskette
in a safe place. Copying the diskette with the command
COPY A:*.* B:
is more reliable than DISKCOPY.
If you have some experience with an RPN calculator, and you can't wait to read
the documentation, enter the command
CALC
and press return when the copyright message appears. You can exit the cal-
culator at any time by pressing 'Q'. If that doesn't work, press 'J' and then
'Q'. The latter will work even if you are using the programmable mode of the
calculator. You may also press 'H' to access a help screen.
Page 2
PC/CALCULATOR
EXECUTING THE CALCULATOR
To start the calculator, enter the command
CALC [P=PRINT-FILE]
[F=FOREGROUND-COLOR]
[B=BACKGROUND-COLOR]
[K=PROGRAM-FILE-TO-RUN]
[L=PROGRAM-FILE-TO-WRITE] [+U]
The items in brackets are optional.
The P=PRINT-FILE-OPTION is used to redirect output to either a file or a
device. Some calculator functions create output which by default goes to the
printer 'PRN:'. To send this output to either a serial printer or a file, en-
ter
CALC P=COM1:
or
CALC P=OUTPUT.FLE
The F=FOREGROUND-COLOR and B=BACKGROUND-COLOR are used to modify the displayed
colors on a color monitor. The color options are
0 - black 3 - cyan 6 - brown
1 - blue 4 - red 7 - white
2 - green 5 - magenta
These options are not useful with a monochrome monitor. Colors other than
black for the background are not recommended. The default colors are black
background and white foreground.
The K= and L= options are described in the programming section.
The +U option is a mnemonic for upper case switch. The ten function key PC/CALCULATOR
II. USING THE CALCULATOR
REVERSE POLISH NOTATION
Using an RPN calculator will take a little practice, but ultimately you may
find it easier to use than an algebraic calculator. All RPN calculators use a
number stack. This is similar to a tray stack at a cafeteria, which drops down
when a tray is placed on top, and which pops up when a tray is removed. The
PC/CALCULATOR stack appears on the screen upside down, with the numbers
pushing each other up and popping them down. If a number is pushed off the top
of the stack, it disappears. Once numbers are pushed onto the stack, they may
be manipulated by the calculator. Some of the function keys as well as the
four standard calculator functions -- add, subtract, multiply, and divide --
use the bottom two numbers in the stack. Each of these functions returns its
result on the bottom of the stack. Many of the function keys work only on the
bottom number in the stack and leave the result on the bottom. The reason for
the 'Reverse' is that, unlike an algebraic calculator where you might enter
NUMBER + NUMBER =,
with an RPN calculator you enter
NUMBER NUMBER +
ENTERING NUMBERS
All numbers entered into the calculator first appear on the line below the
stack marked 'E' for enter. To enter numbers into the calculator, you may use
either the top row of keys of your IBM PC or the keypad. A decimal point may
be entered either using the period key or the 'Del' key.
Errors may be corrected by pressing the backspace key above the return key.
You can clear out the whole 'E' line by pressing Ctrl backspace. Once the num-
ber is correctly entered, press the return key to push the number into the
stack. Once this is done, the number may be negated with the 'N' key. If
anything is entered on the 'E' line and any function key is pressed, the en-
tered number will automatically be pushed into the stack before the function
is executed. The range of numbers that PC/CALCULATOR can handle is approx-
imately 1.E-308 to 1.E+308. To enter a positive exponent, press the 'E' key.
For a negative exponent, use the 'F' key.
FOUR ARITHMETIC FUNCTIONS
Add - Both '+' keys
Subtract - Both '-' keys
Multiply - Both '*' keys and the 'X' key
Divide - Either the '\' or '/' key
Pressing one of these keys causes an arithmetic operation on the two numbers
on the bottom of the stack. The result replaces the two operands.
STACK MANIPULATION
Function key 1 always switches the bottom two numbers on the stack. Function
key 2 pushes a duplicate of the bottom number onto the stack. Shift F1 pops
the bottom number off the stack and puts it back on top. This is called a roll
Page 4
PC/CALCULATOR
operation. Shift F2 always pops the bottom number off the stack and discards
it.
ERRORS
If you make a mistake such as pressing an illegal key or dividing by zero, the
calculator will sound a beep, and print an error message across the bottom of
the screen. A list of all error messages appears in the appendices.
ARITHMETIC EXAMPLE
How do you calculate the following expression?
(5.123 + 2.127) / (6.75 - 4.23)
First enter 5.123 and press return.
Then enter 2.127 and press '+'.
The result should be 7.25.
Enter 6.75 and press return.
Enter 4.23 and press '-'.
The result should be 2.52.
Press '/'.
The result should be 2.8769.
AUXILIARY MEMORIES
The ten auxiliary memories that appear
above the stack may be used with the 'S'
and 'R' keys. To store the number
on the bottom of the stack in an
auxiliary memory, press 'S' followed by
a number 0-9. This will not affect
the stack. To retrieve one of the
auxiliary memories, press 'R' followed
by a number 0-9. This will
push the number in that memory into
the stack. The mekey
or the escape (Esc) key. Pressing the escape key will save the current state
of the calculator in a file called CALC.SAV, which will be read when the cal-
culator is run again. Pressing the 'Q' key will exit the program immediately.
Page 5
PC/CALCULATOR
DISPLAY AND ENTRY MODES
By pressing the 'D' key, you may change the display format of the stack and
auxiliary memories. The 'D' key is pressed followed by one of these keys.
D or F - Floating decimal
0 to 9 - Fixed point decimal
H - Hexidecimal
O - Octal
B - Binary
Full precision is kept for all display modes. Hex, octal, and binary modes
will display *'s when out of range. When in a nondecimal mode, the data entry
from the keyboard is also modified. To enter the hexidecimal values 'A'
through 'F', press the alt key followed by the appropriate letter key. In oc-
tal mode, the digits '8' and '9' are not legal and likewise in binary mode;
only '0' and '1' are allowed. The current mode is always displayed in the up-
per left-hand corner of the screen. Each function key mode has its own display
mode. Beware: changing the function key mode will not reformat the display.
THE UN-DO KEY
Pressing the 'U' key at any time will have the effect of removing the action
of the last key entered. This does not include un-doing an un-do.
TAPE TRACE AND PRINTING
The 'T' and 'Y' keys toggle a tape trace. The 'T' key will cause a tape that
traces the calculator action to be written to the print file. This file is set
on invocation of CALC with the 'P=' option. The default for this file is the
printer.
The 'Y' key causes the tape trace to be printed on the right-hand side of the
screen. This key will not work when using the mouse mode.
At any time, you may press the 'P' key to print out the current values of the
stack and auxiliary memories to the print file.
RADIANS/DEGREES MODE
The regular trigonometric functions take input either in radians or degrees.
The arc trig functions leave output in either radians or degrees. The current
radians/degrees mode is listed under the 'E' line and may be toggled with the
Ctrl-Tab key.
MOUSE MODE
If you use a mouse whose movement simulates cursor control keys and whose but-
ton simulates a return key, then you can use the mouse mode of the calculator.
To toggle the mouse mode, press the 'M' key. Use the mouse to move the block
cursor to point to a part of the screen.
When in mouse mode, you can enter data with the keypad on the right side of
the screen. Also, the auxiliary memories can be used as an alternate source of
the digits 0-9. The hexidecimal digits are available in the lower right-hand
corner. The function keys on the left will work, but be careful to point at
either the top or bottom function of a key. Pointing at the middle line will
do nothing. The functions on the top line are enabled for Store, Restore,
Page 6
PC/CALCULATOR
Help, and the four arithmetic functions.
Page 7
PC/CALCULATOR
III. FUNCTION KEY MODES
There are seven function key modes which are described below. They are all
reachable by pressing the tab key. You can also reach a mode directly by pres-
sing the 'V' key and a number from 1 to 7. Each function key mode has its own
display mode which can be changed with the 'D' key. The current function key
mode is listed below the E line.
CALC - General calculation mode; includes logs and exponen
PC/CALCULATOR
CALC FUNCTION KEY MODE
The function keys in CALC mode all work on a single value in the (X) register
and return a value to the (X) register, except for function keys 9 and 10 and
their shifts. Function key 10 and its shift use the (X) and (Y) register and
return a value in (X). Function key 9 and its shift push constants into the
(X) register. The functions are as follows:
F1 - Swap (X) and (Y)
SH F1 - Roll (X) to top
F2 - Reciprocal of (X)
SH F2 - Round (X) to integer
or fixed accuracy
F3 - Duplicate (X)
SH F3 - Drop (X)
F4 - Natural log of (X)
SH F4 - Euler's constant
raised to (X)
F5 - Square root of (X)
SH F5 - (X) squared
F6 - Log base 2 of (X)
SH F6 - 2 raised to (X)
F7 - Cube root of (X)
SH F7 - (X) cubed
F8 - Log base 10 of (X)
SH F8 - 10 raised to (X)
F9 - Pi constant
SH F9 - Euler's constant
F10 - Log base (Y) of (X)
SH F10 - (Y) raised to (X)
Page 9
PC/CALCULATOR
CALC2 FUNCTION KEY MODE
The function keys in CALC2 mode have miscellaneous functions. Keys F5, F7, F9,
and their shifts are for markup calculations. Key F2 and its shift are for per-
cent calculations. Key F4 and its shift are for adding and subtracting numbers
from auxiliary memory 0. Key F6 and its shift and key F8 are for combinatoric
problems.
To do a markup calculation, you need to know two of the three variables: cost,
selling price, and markup percent. Enter the two variables by entering a num-
ber followed by the appropriate function key: F5, F7, or F9. These values are
stored respectively in memories 6, 7, or 8.
Markup Calculations
F5 - Cost Memory 6
F7 - Selling price Memory 7
F9 - Markup percent Memory 8
To calculate the unknown variable, press the shifted function key.
Markup Calculation Examples
Find the selling price of an item that costs $15.95 with a markup of 20%.
KEY(S) EXPLANATION
1. D
2. 2 Set display mode fixed 2
3. 15.95
4. F5 (COST) Set cost
5. 20
6. F9 (MARKUP %) Set the markup percent
7. Shift F7 Calculate the sell price
Answer in (X) 19.94
Find the markup of an item that costs $45.45 and retails for $99.95.
1. D
2. 0 Set display mode fixed 0
3. 45.45
4. F5 (COST) Set cost
5. 99.95
6. F7 (SELL) Set the selling price
7. Shift F9 Calculate the markup %
Answer in (X) % 55
Percent Calculations
To enter a percent, first enter the number, then press F2, the percent key.
This key divides the (X) register by 100.
To find a percent change, enter the two numbers into the stack registers (X)
and (Y) and press shift F2, the delta percent key.
Delta Percent Example
Sales of a product increase from 15,000 units to 24,000 units in one period.
What is the percent change?
Page 10
PC/CALCULATOR
1. 24000
2. ENTER New value
3. 24000 Old value
4. Shift F2 (Delta percent)
Answer in (X) 60
Sum a List of Numbers Example
To sum up your check register, do the following:
1. D Change display
2. 2 To two fixed decimals
3. C
4. C Clear all registers
5. 94.56 Item 1
6. F4 Add it to memory 0
7. 14.00 I result will
be in the (X) register.
To find Px:y or the number of permutations of x items taken y at a time, enter
x and y into the stack registers (X) and (Y) and press shift F6. The answer
will be in (X).
To find Cx:y or the number of combinations of x items taken y at a time, enter
x and y into the stack registers (X) and (Y) and press shift F6. The answer
will be in (X).
Note that the combinatoric functions are limited in accuracy for large num-
bers.
Page 12
PC/CALCULATOR
TRIG FUNCTION KEY MODE
All the functions keys in TRIG mode work on a single value in the (X) register
and return a value to the (X) register, except for function key 10 and its
shift. Function key 10 and its shift push constants into the (X) register. The
functions are as follows:
F1 - Swap
SH F1 - Roll
F2 - Inverse sine
SH F2 - Inverse hyperbolic sine
F3 - Duplicate
SH F3 - Drop
F4 - Inverse cosine
SH F4 - Inverse hyperbolic cosine
F5 - Sine
SH F5 - Hyperbolic sine
F6 - Inverse tan
SH F6 - Inverse hyperbolic tan
F7 - Cosine
SH F7 - Hyperbolic cosine
F8 - Inverse tan of (Y)/(X)
SH F8 - No function
F9 - Tan
SH F9 - Hyperbolic tan
F10 - Pi constant
SH F10 - Euler's constant
Page 13
PC/CALCULATOR
STATS FUNCTION KEY MODE
Stats mode allows you to enter either multiple values or multiple ordered
pairs. Once entered, there are function keys for calculating the variance,
standard deviation, and mean. When entering ordered pairs, there are functions
keys for calculating least squares determination of slope, y intercept, and
correlation coefficient. Values can also be projected using either new x or y
coordinates. Using the trend sum key, data may be entered with the x value
automatically incremented.
Entering Statistical Data
Statistical data may be entered in either x, y pairs or x values alone. The
usual way to enter data is to enter each x, y pair into the bottom of the
stack and then press the statistical summation key, F2. Values may be removed
by following the same procedure but by pressing the shift F2 key instead.
When performing trend analysis, start by putting the first x value in the (Y)
register and the first y value in the (X) register. Pressing shift F10 will
sum the values and leave an incremented x value on the bottom of the stack.
Thereafter, you only need enter a y value and press shift F10 to enter more
data.
PC/CALCULATOR keeps intermediate values in memory registers 3 - 8. These may
not be used while doing statistical calculations without corrupting the
results. The values kept are:
Memory 3 - Number of entries
Memory 4 - Sum of x values
Memory 5 - Sum of y values
Memory 6 - Sum of x squared
Memory 7 - Sum of y squared
Memory 8 - Sum of x * y
Calculating Statistical Values
Once your data is entered, you can immediately calculate some important
statistical results by pressing the following function keys. All results are
returned in the (X) register.
F5 - Variance of x values
with weight n-1
Shift F5 - Variance of x values
with weight n
F7 - Standard deviation of x's
with weight n-1
Shift F7 - Standard deviation of x's
with weight n
F8 - Standard deviation of y's
with weight n-1
Shift F8 - Standard deviation of y's
, enter the x value in the (X)
register and press F6. The new y value will be in the (X) register.
To find a new x value for a given y value, enter the y value in the (X)
register and press shift F6. The new y value will be in the (X) register.
Page 15
PC/CALCULATOR
PROG FUNCTION KEY MODE
All the functions available in PROG mode work on either the (X) and (Y)
register or just the (X) register. They all return their values in the (X)
register. All calculations are made by first converting floating point numbers
to integer, so fractional parts of an entered number will be lost. You may
find it particularly useful here to use either Hex or Binary display mode when
using this key function mode. The functions are as follows:
F1 - Swap (X) and (Y)
F2 - Shift (X) 1 bit right
F3 - Duplicate (X)
F4 - Shift (X) 1 bit left
F5 - Bitwise AND of (X) and (Y)
F6 - Shift (X) (Y) bits right
F7 - Bitwise OR of (X) and (Y)
F8 - Shift (X) (Y) bits left
F9 - Bitwise EXCLUSIVE
OR of (X) and (Y)
F10 - One's complement (X)
Note that two's complement of (X) is obtainable by doing an EXCLUSIVE OR (F9)
with (Y) set to 0.
Page 16
PC/CALCULATOR
FIN FUNCTION KEY MODE (Financial)
Financial mode is certainly the most complex function key mode available in
PC/CALCULATOR. For further help in using this mode, I recommend Executive Cal-
culator Guidebook, available from Texas Instruments product centers.
This mode uses the auxiliary memories 5-9 to store percent interest, periods,
payment, present value, and future value, which are the five variables used to
perform financial calculations. These values are stored by entering a number
and pressing the appropriate function key. In general, there are two main
types of financial problems that can be solved: compound interest problems and
annuity problems. Annuity problems can be further broken down into straight an-
nuity problems and annuity due problems.
PC/CALCULATOR recognizes a problem as a compound interest problem if no pay-
ment amount is entered and one of the calculate percent interest, calculate
periods, calculate present value, or calculate future value keys is pressed.
Otherwise, a problem is assumed to be an annuity problem.
Annuity problems are set to the annuity due mode by pressing shift F5 and then
are set back by pressing F5. When in annuity due mode, the word DUE is
displayed below the E line. Annuity due problems are annuity problems where
the payments are made at the beginning of each period. Normal annuities are
paid at the end of the period. If the calculate present value key or calculate
future value key is pressed, the other three variables (percent interest,
periods, and payment) are used to calculate the result. If one of the cal-
culate percent interest, periods, or payment keys is pressed, three variables
are used to do the calculation. Two of these variables are chosen from percent
interest, periods, and payment, and the third varialbe is either future value
or present value. If both future and present values have been entered, then
the most recently entered value is the one used.
When calculating percent interest, there is always the possibility that the
variables entered are inconsistent. If so, the iterative process used to com-
pute the value will not converge. An error message is printed aftery be solved for by pressing shift F6.
Annuity Problems
For annuity problems, first set the annuity mode by pressing F5 or shift F5.
The variables in annuity problems are the same as for compound interest
problems with the addition of payment (F6). In general, you enter four of the
five variables and solve for the unknown by pressing the shifted function key.
Page 17
PC/CALCULATOR
You may only use either present value or future value in such a calculation.
PC/CALCULATOR always remembers the last value entered and uses it.
Caution must be used when calculating percent interest in an annuity problem.
The solution is solved for iteratively. If bogus data is used, the result
could be that PC/CALCULATOR tries as many as 1000 iterations before giving up.
If this happens, you will receive an error message. Without an 8087 chip, this
could take a few minutes. If you want to stop the process, the only way is to
press CTRL-BREAK, which will return you to DOS.
Once your data is entered, you may compute four more important financial
values by first putting a number of periods in the (X) register and then pres-
sing the following function keys:
F7 - Balance due on a loan
after (X) payments
Shift F7 - Accrued interest on a
loan after (X) payments
F9 - Interest on current payment
after (X) payments
Shift F9 - Principal on current payment
after (X) payments
FINANCIAL EXAMPLES
Example 1. You have $15,000 in a savings account at 14% interest computed mon-
thly. After one year, what is the balance?
NUMBER ACTION
14.00 Enter
12.00 Enter
1.17 /
Enter i%
12.00 Enter
Enter periods
15000.00 Enter
17240.13 Calculate future value
Answer: Balance after one
year = $17240.13
Example 2. You have a savings account at 14% interest computed monthly. You
deposit $1000 a month for one year. What is the balance after one year?
14.00 Enter
12.00 Enter
1.17 /
Enter i%
12.00 Enter
Enter periods
1000.00 Enter
Enter payment
12800.75 Calculate future value
Answer: Balance after one
year = $12800.75
Example 3. You take out a car loan for $10,000 at 16% for four years. What is
the payment?
16.00 Enter
Page 18
PC/CALCULATOR
12.00 Enter
1.33 /
Enter i%
12.00 Enter
4.00 Enter
48.00 *
Enter periods
10000.00 Enter
Enter present value
283.40 Calculate payment
Answer: Payment is $283.40
Example 4. You take out a home improvement loan for $20,000 at 12%. You wish
to pay $800 a month. How long will it take to pay off the loan?
12.00 Enter
12.00 Enter
1.00 /
Enter i%
800.00 Enter
Enter payment
20000.00 Enter
Enter present value
28.91 Calculate periods
28.00 Enter
722.54 Balance
Answer: 29 months with the
final payment of $722.54
Example 5. Your home mortgage is $100,000 at 11% for 30 years. After 5 years,
what part of your payment is interest, and what part is principle?
11.00 Enter
12.00 Enter
.92 /
Enter i%
30.00 Enter
12.00 Enter
360.00 *
Enter periods
100000.00 Enter
Enter present value
952.32 Calculate payment
5.00 Enter
12.00 Enter
60.00 *
891.24 Interest
60.00 Cancel
61.09 Principle
Answer: Of a payment of $952.32,
$891.24 is interest,
and $61.09 is principle
Example 6. Your friend offers you a loan of $1000 if you will pay him $100 a
month for 13 months. What inteou plan to add $2000 a year for 30 years. How much will you
have when you retire on?
9.00 Enter
Enter i%
30.00 Enter
Enter periods
10000.00 Enter
Enter present value
132676.78 Calculate future value
2000.00 Enter
132676.78 Enter payment
272615.08 Calculate future value
405291.86 +
Answer: A nest egg of $405,291.86
Page 20
PC/CALCULATOR
CONV FUNCTION KEY MODE
The function keys in CONV mode may be used to convert between various physical
units, such as between metric and English units. The amount to be converted is
entered, and the result is found at the bottom of the stack. To convert to a
unit, press the function key with that unit's name.
F1 - Swap (X) and (Y)
SH F1 - Roll (X) to top
F2 - Centimeters to inches
SH F2 - Inches to centimeters
F3 - Duplicate (X)
SH F3 - Drop (X)
F4 - Kilometers to miles
SH F4 - Miles to kilometers
F5 - Kilograms to pounds
SH F5 - Pounds to kilograms
F6 - Square centimeters to
square inches
SH F6 - Square inches to
square centimeters
F7 - Liters to U.S. gallons
SH F7 - U.S. gallons to liters
F8 - Hectares to acres
SH F8 - Acres to hectares
F9 - Degrees Celcius to
degrees Fahrenheit
SH F9 - Degrees Celsius to
degrees Fahrenheit
F10 - Cubic meters to
cubic feet
SH F10 - Cubic feet to
cubic meters
Page 21
PC/CALCULATOR
IV. BACKGROUND CALCULATOR
OVERVIEW
The background calculator is a special version of PC/CALCULATOR that may be
loaded into your computer, where it is available while other programs are
being run. An invocation key is chosen which suspends the running program and
starts the calculator. Any key may be chosen as the invocation key. The back-
ground calculator is more limited than the regular version and will not run
calculator programs. The features that print to disk or printer, such as the
'P' key and the 'T' key, are not available. There is only one generic help
screen, which can't be read from disk. The background calculator will not run
with DOS version 1.0 or 1.1; you must have version 2.0.
INSTALLING THE BACKGROUND CALCULATOR
To start the background calculator, enter the command
BCALC
[E=CODE-NUMBER | -E]
[F=FOREGROUND-COLOR]
[B=BACKGROUND-COLOR] [+U]
The 'F=' and 'B=' options are the same as for the regular calculator. There
are two ways to choose the invocation key: by pressing a key or by entering a
parameter on the command line. If no 'E=' option is entered, the calculator
will prompt you for an invocation key. This key may be any key and may be used
with a shift, Alt, or Ctrl key. The location of the key is very important. The
'1' key over the letter 'Q' is different from the '1' key on the keypad. When
pressed, the invocation key will suspend the current program and start the cal-
culator.
This method of setting the invocation key does not work when used in a batch
file such as AUTOEXEC.BAT. Instead, you may specify a key with the 'E=' op-
tion. To find the code number for a key, you must use the program FINDKEY,
which is located on the distribution diskette. Run FINDKEY and press the in-
vocation key that you wish to use. FINDKEY will display the code number for
that key on the screen.
Note: The '-E' option, which may not be used with the 'E=' option, will cause
the bHE BACKGROUND CALCULATOR
With the exceptions noted above, the background calculator will function the
same as the regular calculator. It does have one additional key: the 'B' key.
Pressing this key will allow you to review the last screen of the program you
Page 22
PC/CALCULATOR
were running before invoking the calculator. By using the 'B' key, you can
review any numbers that you may want to use in your calculations. After this
key is pressed, the next key entered will return you to the calculator.
EXITING THE BACKGROUND CALCULATOR
You may leave the background calculator and return to your program by pressing
either the escape key (Esc) or the 'Q' key. The state of the calculator will
remain unchanged. If you return to the calculator at a later time, the stored
numbers will be there if you need them. If you use the escape key to exit the
calculator, the program you were running will restart immediately. However, if
you use the 'Q' key to exit, up to 14 digits of the bottom number on the stack
will be stored in the keyboard input buffer. These digits will then be entered
to the program you were running just as if you had keyed them in yourself.
Page 23
y to e÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷